The present invention pertains to the field of postage meters and other mailing equipment. More particularly, the present invention pertains to programming flash memory used in mailing equipment.
Referring to FIG. 1A, a mailing apparatus 13, such as a postage meter 17 shown in FIG. 1B, often includes a microprocessor 14 having no read only memory (ROM), but having random access memory (RAM) 16 for holding program instructions to be executed by the microprocessor 14. Consequently, software, i.e. program instructions and data, can be stored in so-called flash memory 15, a type of non-volatile memory. The flash memory software to load 10 is often provided by a flash memory programmer 12 through a personal computer (PC) 11 linked to the microprocessor 14 of the mailing apparatus 13. The microprocessor 14 has a universal asynchronous receiver/transmitter (UART) (not shown), which routes the software 10 from the PC 11 to the flash memory device 15.
The flash memory software to load 10 is first loaded at the time the mailing apparatus is manufactured, and from time to time, it is desirable to change the program instructions and data in the flash memory, for example to incorporate revisions to the program instructions or to change the data used in operating the mailing equipment. The act of writing software to a flash memory is called xe2x80x9cprogrammingxe2x80x9d the flash memory. A flash memory is a device providing erasable programmable read only memory containing many sectors, each sector containing a number of bytes, where each sector is separately erasable. In addition, a flash memory device is often byte programmable. Often also, flash memory is block erasable/writable, blocks being groups of bytes. Usually, a flash memory device is divided into a plurality of volumes, which are the unit-erasable quantity of memory on a given piece of hardware. A volume may be a single sector or multiple sectors of a storage space representing the capacity of the memory. Prior to writing to, or programming, a location within the memory device, the volume within which the location is found must be erased and then the whole volume is rewritten to include the programmed location. Thus, programming of a single location requires an erase cycle of the volume within which the single location is located, and a write time to rewrite the erased volume. Typical erase cycles do not take long (approximately one second), but it is possible for a typical write cycle (time to program all of flash memory of a typical mailing apparatus using flash memory) to require up to 15 minutes.
According to the prior art, the software for a mailing apparatus is loaded into the flash memory as a single build, i.e. software including routines that call each other to provide the functionality of the mailing apparatus. The routines are able to call each other, according to standard programming practice, using function calls that are compiled and made operative by linking the routines together. Referring to FIG. 2 and again to FIG. 1A, a single build as provided by the prior art is arranged in the flash memory 15 of a mailing apparatus 13, and includes power up routines 24, operating system routines 25, application software 26. Some of the flash memory is shown as unused flash memory 27.
All of the software must be written (programmed) into the flash memory for the mailing apparatus to work correctly. If a power failure interrupts the programming of the flash memory, the flash memory must be erased, and the programming of the flash memory must be started again from the beginning. When flash memory is being reprogrammed (either at a user""s facility or at a manufacturing site), if power fails during the reprogramming, the mailing apparatus is completely inoperative, since it has no ROM for holding even boot-up routines. As indicated above, flash memory write cycles are often long, and reprogrammed from the beginning causes delays which are often costly.
Therefore, there is a need for a way to program flash memory of a mailing apparatus so as to avoid the long delays caused by a power failure during programming, and the subsequent restarting of the programming process.
The present invention seeks to provide a system of programming the flash memory of a mailing apparatus so that in case of a power failure during some of its programming, or in case of a need to reprogram at least some parts of the flash memory, only part of the programming must be performed. It does this by providing a method of programming flash memory of a mailing apparatus in more than one build, with one build containing only a fraction of the software needed to impart to the mailing apparatus its full functionality, but all of the software needed to link to a PC and to reprogram at least some sectors of the flash memory (i.e. erase and write sectors of flash memory). After writing this so-called kernel software into sectors of flash memory, the sectors are locked, i.e. are prevented by software from being erased and rewritten. The other builds are written to sectors that are not necessarily locked. The invention includes embodiments differing chiefly in what software is included in the kernel software.
Accordingly, the present invention provides a method of programming a mailing apparatus, the mailing apparatus comprising a microprocessor and a flash memory, the programming amounting to writing, to sectors of the flash memory, software needed for operation of the mailing apparatus, the method comprising the steps of: providing, as one build, kernel software, including routines for programming the flash memory, creating in particular sectors of flash an image of the one build, and then locking the sectors; and providing, as at least one other, separate build, all other software, and creating an image in flash of each other build.
In some applications of the present invention, the kernel software comprises: power-up routines automatically loaded by the microprocessor at power on, these for initializing the microprocessor, for initializing communications between the microprocessor and a programming computer, for enabling the microprocessor to read and write to the flash memory; and for loading operating system software; the operating system software itself, comprising routines for providing system-oriented functionality of the mailing apparatus, and kernel application software, comprising routines for providing application-oriented functionality, including enabling the microprocessor to be used by a programming computer to reprogram the non-kernel software.